<?php 
$quyen01 = $this->users->getQuyen($this->session->userdata("user_id"));
if(count($quyen01) > 0){
	foreach($quyen01 as $q){
		$quyen[] = $q->id_quyen;
	}
}
else
	$quyen = array();
?>
<div class="content">
	<div class="content_header">THÔNG BÁO MỚI</div>
	<?php 
	$tittle = $new->tieude_tintuc;
	$noidung = $new->noidung_tintuc;
	$date = $new->ngay_tintuc;
	$user = $new->tenthat_nguoidung;
	?>
	<div class="content_news">
		<div class="news_box first_box">
			<div class="news_box_header">
				<?php echo $tittle;?>
				<?php 
				$user_id = $this->session->userdata("user_id");
				if((in_array(3, $quyen) && $user_id == $new->id_nguoidung) || $user_id=12){
	                ?>
				<a class="suabutton"
					href="<?php echo base_url().'tintuc/viewEditTintuc/'.$new->id_tintuc?>">Sửa</a>
				<a class="suabutton"
					href="<?php echo base_url().'tintuc/delTintuc/'.$new->id_tintuc?>">Xóa</a>
				<?php }?>
			</div>
			<div class="news_box_time">
				<?php echo $date." - ".$user;?>
			</div>
			<div class="news_box_content">
				<?php echo $noidung;?>
			</div>
		</div>
	</div>
	<?php 
	echo ($new->tailieu_tintuc==null)?"Không có tài liệu":"<a href='".site_url('tintuc/download/'.$new->id_tintuc)."'>".$new->tailieu_tintuc."</a>";
	echo "</br>";
	?>
</div>
<div style="clear:both"></div>
</div>
